In this paper, we considered a Bayesian hierarchical method using the hyper product inverse moment prior in the ultrahigh-dimensional generalized linear model (UDGLM), that was useful in the Bayesian variable selection. We showed the posterior probabilities of the true model converge to 1 as the sample size increases. For computing the posterior probabilities, we implemented the Laplace approximation. The Simpli ed Shotgun Stochastic Search with Screening (S5) procedure for generalized linear model was suggested for exploring the posterior space. Simulation studies and real data analysis using the Bayesian ultrahigh-dimensional generalized linear model indicate that the proposed method had better performance than the previous models. Keywords: Ultrahigh dimensional; Nonlocal prior; Optimal